home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DJGPP
/
AECUR102.ZIP
/
contrib
/
curses
/
src
/
wdelch.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-09
|
772b
|
35 lines
/*------------------------------------------------------------
*
* wdelch.c
*
* copyright (c) 1987,88,89,90 J. Alan Eldridge
*
* deletes a char at the cursor position in a window
* rightmost char on line is blanked
*
*----------------------------------------------------------*/
#include "curses.h"
int
wdelch(win)
WINDOW *win;
{
VIDCHR *ptr;
int cury, curx, endcol;
getyx(win, cury, curx);
markwin(win);
endcol = win->maxx;
ptr = &(win->buf[cury][curx]);
memcpy(ptr, ptr + 1, (endcol - curx) * sizeof(VIDCHR));
wmove(win, cury, endcol);
win->buf[cury][endcol].chr = ' ';
win->buf[cury][endcol].att = win->attrib;
markwin(win);
wmove(win, cury, curx);
return OK;
}